<%@ page import="com.edu.dreams.entity.User"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	User user = (User) request.getSession().getAttribute("user");
%>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>童话世界</title>
<meta name="description" content="一个充满童话世界的地方，带你回味童年." />
<meta name="keywords" content="童话、英雄和魔法" />
<link rel="shortcut icon" href="images/favicon.ico" />
<!-- 引入bootstrap 样式文件 -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- 引入我们自己的样式文件 -->
<link rel="stylesheet" href="css/news2.css">
<!-- 先引入jquery js文件 -->
<script src="js/jquery-3.5.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
</head>

<body>
	<!-- 导航栏 -->
	<nav class="navbar navbar-default">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
					aria-expanded="false">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand"
					href="${pageContext.request.contextPath}/home"><img
					style="margin-left: 15px;" src="images/logo.jpg" alt="童话世界"></a>
			</div>

			<div class="collapse navbar-collapse"
				id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav">
					<li><a
						href="${pageContext.request.contextPath}/home">首页 <span
							class="sr-only">(current)</span></a></li>
					<li><a href="${pageContext.request.contextPath}/animations">动画</a></li>
					<li class="active"><a
						href="${pageContext.request.contextPath}/news">资讯</a></li>
					<li><a href="${pageContext.request.contextPath}/rank">排行榜</a></li>
					<li><a href="${pageContext.request.contextPath}/personal">个人中心</a></li>
				</ul>
				<form action="${pageContext.request.contextPath}/searchAnim"
					method="post" class="navbar-form navbar-left">
					<div class="form-group">
						<input type="text" name="animname" class="form-control"
							placeholder="搜索动画">
					</div>
					<button type="submit" class="btn btn-default">搜索</button>
				</form>
				<ul class="nav navbar-nav navbar-right">
					<li><a href="${pageContext.request.contextPath}/personal"><%=user.getUser_name()%> </a></li>
					<li><a href="${pageContext.request.contextPath}/logout">退出登录</a></li>
				</ul>
			</div>
			<!-- /.navbar-collapse -->
		</div>
		<!-- /.container-fluid -->
	</nav>

	<!--主体内容-->
	<div class="container">
		<h1>${newdata.news_name}</h1>
		<div class="gray">
			来源：<a href="#">${newdata.news_src}</a>
			<form action="searchNews" method="post">
				<input type="text" name="animname" placeholder="搜索新闻" class="search ">
				<input type="submit" class="but " value="搜索">
			</form>
		</div>
		<hr>

		<div class="container">
			<div class="row">
				<p class="img">
					<img class="img-responsive" style="margin: 10px auto;"
						src="${pageContext.request.contextPath}/upload/${newdata.news_picurl}"
						alt="${newdata.news_name}">
				</p>
			</div>
		</div>

		<div class="row">
			<div class="col-md-3 hidden-xs">
				<div class="list-group">
					<a href="javascript:;" class="list-group-item"
						style="color: blue; font-size: 26px;">漫圈动态</a>
					<c:forEach var="item" begin="0" end="5" items="${newsdata}">
						<a
							href="${pageContext.request.contextPath}/newsshow?id=${item.news_id}"
							class="list-group-item">${item.news_name}</a>
					</c:forEach>
				</div>
			</div>

			<div class="col-md-9 col-xs-12">
				<p>${newdata.news_content}</p>
				<p class="footer">本文来源：${newdata.news_src}</p>
			</div>
		</div>
	</div>

	<!--页面尾部-->
	<div class="footer container">
		<hr>
		<p class="text-center">2020-forever</p>
	</div>
</body>

</html>